package com.bjsc.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.bjsc.entity.SpendRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author create by VIC.Huang
 * @date 2018/2/8
 */
@Mapper
public interface SpendRecordMapper extends BaseMapper<SpendRecord> {
    @Select("select tsr.id, tsr.user_id userId, tu.nick_name userName, tsr.type, tsr.money, tsr.create_time createTime" +
            " from t_spend_record tsr" +
            " left join t_user tu on tsr.user_id = tu.id" +
            " where type = #{spendType} order by id desc")
    List<Map<Object,Object>> selectSpendRecordList(Page<Map<Object, Object>> page, @Param("spendType") String spendType);
}
